import React from 'react';

export default class list extends React.Component {

    state = {
        list:['a','b','c']
    };
    createList(){
        const domlist = [];
        this.state.list.forEach((item,i) => {
            domlist.push( <div key={ i }>{ item }</div> )
        })
        return domlist;
    }
    render() {
        return (
            <div>
                {/* {
                    this.state.list.map((d,i)=><div key={ i }>{d}</div>)
                } */}
                {this.createList()}
            </div>
        );
    }

}
